-
-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Vector Zero Funcs. & Improve Vector.Inc File #549
base: master
Are you sure you want to change the base?
Conversation
Add **bool: IsVectorZero ( Float: Vector [ 3 ] )** to check whether a vector equals to zero. Add **SetVectorZero ( Float: Vector [ 3 ] )** to assign a vector to zero. Remove redundant tabs at some lines. Fix spelling @ **get_distance_f**. This PR intends to complete AMXX's Vector library adding new stuff to it. Also, the new two functions listed above will help plugins using this kind of stuff look more readable.
Same can be accomplished by using xs_vec_equal and xs_vec_set. This functions are a bit easier to use than xs_* but I'm not sure the difference is significant enough. |
XS is a file that has lots of data inside. As you can see @ https://github.com/ValveSoftware/source-sdk-2013/blob/master/sp/src/public/mathlib/vector.h#L564 Also, XS restricts all functions to use float parameters. |
Does pawn have any difference between set 0 or 0.0 to Float? |
warning 213: tag mismatch via http://www.amxmodx.org/webcompiler.cgi |
I mean in memory. Warning we can bypass and if there are no difference for what we need 2 funcs for int and float? |
I don't understand what you mean. Show me an example so I can understand. |
We know pawn has only cell type.
If in pawn VM there are no difference(example, all bytes are zero for first and second variant) we can use one func for int and float. |
@Mistrick there is no difference, we can write function that accepts both |
Basically we can just add vec = ZERO_VECTOR;
xs_vec_equal(vec, ZERO_VECTOR); |
If I add public stock const Float: ZERO_VECTOR [ 3 ] inside AmxConst.INC, it will act as Float only. Furthermore, I still don't want to use xs_* functions to check whether a Vector equals to zero. So, do you still want me to add public stock const Float: ZERO_VECTOR [ 3 ] inside AmxConst.INC? |
@ClaudiuHKS I think integer vectors should be deprecated. |
Add bool: IsVectorZero ( const { _, Float }: Vector [ 3 ] ) to check whether a vector equals to zero.
Add SetVectorZero ( { _, Float }: Vector [ 3 ] ) to set a vector to zero.
Remove redundant tabs at some lines.
Fix spelling @ get_distance_f.
This PR intends to complete AMXX's Vector library adding new stuff to it.
Also, the new two functions listed above will help plugins using this kind of stuff look more readable.